


cap confirm file "$data_out/Promotions.dta" 
if _rc!=0 { 
do "$Outcomes/Promotions.do"
}
else use "$data_out/Promotions.dta" 

label var ed_prescription "Prescription in ED"
label var promotion1 "Probability of Promotion within 1 Year"
label var promotion2 "Probability of Promotion within 2 Years"
label var demotion1 "Probability of Demotion within 1 Year"
label var demotion2 "Probability of Demotion within 2 Years"



foreach outcome in promotion1 promotion2 demotion1 demotion2 {
eststo `outcome'_C:	ivreghdfe `outcome' $spec_promotions1
estadd ysumm, replace

eststo `outcome'_Q:	ivreghdfe `outcome' $spec_promotions2
estadd ysumm, replace
}

#delimit ;

	//word
esttab promotion1_C promotion2_C demotion1_C demotion2_C using "promotions.rtf" , 
	replace label se star(* 0.10 ** 0.05 *** 0.01)
	b(4) se(4)
	stats(ymean N ,
	fmt(a2 %-9.0fc)
	label("Sample Mean" "Observations"))
		keep(ed_prescription)
		title(IV Results for Probability of Promotion and Demotion - Prescribing Rate Instrument);
		
		
esttab promotion1_Q promotion2_Q demotion1_Q demotion2_Q using "promotions.rtf" , 
	append label se star(* 0.10 ** 0.05 *** 0.01)
	b(4) se(4)
	stats(ymean N ,
	fmt(a2 %-9.0fc)
	label("Sample Mean" "Observations"))
		keep(ed_prescription)
		title(IV Results for Probability of Promotion and Demotion - 4th vs 1st Quartile Instrument);
		

 
#delimit cr
